<template>
  <layout>
    <div class="warp">
			<div class="main_l">
				<div class="banner">
					<view class="uni-margin-wrap">
						<swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="1500"
							:duration="500">
							<swiper-item>
								<img src="@/static/img/banner-1.jpg">
							</swiper-item>
							<swiper-item>
								<img src="@/static/img/banner-2.gif">
							</swiper-item>
							<swiper-item>
								<img src="@/static/img/banner-3.jpg">
							</swiper-item>
							<swiper-item>
								<img src="@/static/img/banner-4.gif">
							</swiper-item>
						</swiper>
					</view>
					<div class="slide-r">
						<h4>关于博主</h4>
						<div v-html="detail.content"></div>
						<!-- <ul>
							<li>
								<h4>关于博主</h4>
								<div v-html="detail.content"></div>
							</li>
						</ul> -->
					</div>
				</div>
				<!--最新作品-->
				<div class="news_works">
					<h3 class="news_works_title">最新作品</h3>
					<ul class="news_works_ul">
          <li v-for="(item,index) in dataTable" :key="index">
            <figure>
              <router-link :to="'/detail??table=works&title=个人作品&&id='+item._id"> <img src="@/static/img//person_1.jpg" /></router-link>
            </figure>
            <div class="news_work_txt">
              <h4 class="news_work_txt_name">{{item.title}}</h4>
              <div class="news_work_txt_p" v-html="item.content">
              </div>
              <router-link :to="'/detail??table=works&title=个人作品&&id='+item._id" class="news_work_txt_link">详情</router-link>
              <p>
                <span class="classic">个人作品</span>
                <span class="time">{{(item.create_time)}} </span>
              </p>
            </div>
          </li>
        </ul>
				</div>
			</div>
      <!-- 首页右边 -->
			<newWorks/>
		</div>
  </layout>
</template>
<script>
import layout from '@/layout/index.vue'
import newWorks from '@/components/newWorks'
export default {
  components:{layout,newWorks},
  data() {
    return {
			dataTable:[],
			detail:{	//关于我
				content:'' 
			}
    }
  },
  mounted(){
    this.getList()
  },
  computed:{
  },
  methods:{
		// 列表
    getList(){
      const that = this
			const data={
        table:'works'
      }
			this.$Ajax('getPageList',data,res=>{
				console.log(res.data)
        that.dataTable = res.data
			})
			const data1={
        table:'about'
      }
			this.$Ajax('getLists',data1,res=>{
				console.log(res.data)
        that.detail = res.data.length>0 ?res.data[0] :{}
			})
    },
  },
}
</script>
<style scoped>

</style>
